package com.work.washer.controller;

import com.work.washer.model.Send;
import com.work.washer.service.SendService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author cys
 * @date 2024/4/26 18:40
 */
@Tag(name = "配送")
@RestController
@RequestMapping("/send")
public class SendController {

    @Autowired
    private SendService sendService;

    /**
     * 添加
     *
     * @param send 发送
     * @return boolean
     */
    @Operation(summary = "新增")
    @PostMapping("/save")
    public boolean save(@RequestBody Send send) {
        return sendService.save(send);
    }

    @Operation(summary = "列表")
    @GetMapping("/list")
    public List<Send> list() {
        return sendService.list();
    }



}
